home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH13 / 13-3-2.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  2.1 KB  |  76 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPokerHand 
  3.    Caption         =   "Poker Hand"
  4.    ClientHeight    =   1905
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   2640
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   1905
  10.    ScaleWidth      =   2640
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.PictureBox picHand 
  13.       Height          =   1095
  14.       Left            =   120
  15.       ScaleHeight     =   1035
  16.       ScaleWidth      =   2355
  17.       TabIndex        =   3
  18.       Top             =   120
  19.       Width           =   2415
  20.    End
  21.    Begin VB.CommandButton cmdQuit 
  22.       Caption         =   "&Quit"
  23.       Height          =   495
  24.       Left            =   1800
  25.       TabIndex        =   2
  26.       Top             =   1320
  27.       Width           =   735
  28.    End
  29.    Begin VB.CommandButton cmdDeal 
  30.       Caption         =   "&Deal"
  31.       Height          =   495
  32.       Left            =   960
  33.       TabIndex        =   1
  34.       Top             =   1320
  35.       Width           =   735
  36.    End
  37.    Begin VB.CommandButton cmdShuffle 
  38.       Caption         =   "&Shuffle"
  39.       Height          =   495
  40.       Left            =   120
  41.       TabIndex        =   0
  42.       Top             =   1320
  43.       Width           =   735
  44.    End
  45. Attribute VB_Name = "frmPokerHand"
  46. Attribute VB_GlobalNameSpace = False
  47. Attribute VB_Creatable = False
  48. Attribute VB_PredeclaredId = True
  49. Attribute VB_Exposed = False
  50. Private WithEvents cards As CDeckOfCards
  51. Attribute cards.VB_VarHelpID = -1
  52. Private Sub cmdDeal_Click()
  53. Dim str As String
  54. Dim i As Integer
  55.   picHand.Cls
  56.   For i = 1 To 5
  57.     str = cards.ReadCard(i)
  58.     picHand.Print str
  59.   Next i
  60. End Sub
  61. Private Sub cmdQuit_Click()
  62.   End
  63. End Sub
  64. Private Sub cmdShuffle_Click()
  65.   Call cards.ShuffleDeck
  66. End Sub
  67. Public Sub cards_shuffling(n As Integer, nMax As Integer)
  68.   'n is the number of the specific pass through the deck (1, 2, 3..)
  69.   'nMax is the total number of passes when the deck is shuffled
  70.   picHand.Cls
  71.   picHand.Print "Shuffling Pass:"; n; "out of"; nMax
  72. End Sub
  73. Private Sub Form_Load()
  74.   Set cards = New CDeckOfCards
  75. End Sub
  76.